package a.f.h.a.b;

import a.c.*;
import a.c.d;
import a.c.e;
import a.c.m;
import a.c.q;
import a.f.h.a.a.g;
import a.f.j.cb;
import a.f.j.j;
import a.i.l;

import java.util.Comparator;

public class b
{
  q a;
  cb b;
  private a.f.h.a.a.b c;
  private x d;
  private a.c.n e;
  private final j g = new j()
  {
    public d a(d paramAnonymousd)
    {
      return b.this.l(paramAnonymousd);
    }
  };
  public static int h;
  public static boolean i;
  
  public b(a.f.o paramo, a.f.h.a.a.b paramb)
  {
    this.a = paramo;
    this.c = paramb;
    this.d = paramo.B();
    this.e = paramo.C();
  }
  
  public void a(cb paramcb)
  {
    this.b = paramcb;
  }
  
  public void a()
  {
    this.a.a(this.d);
    this.a.a(this.e);
  }
  
  public a.f.h.a.a.b b()
  {
    return this.c;
  }
  
  public cb c()
  {
    return this.b;
  }
  
  public q d()
  {
    return this.a;
  }
  
  public boolean a(d paramd)
  {
    return this.b.h(paramd);
  }
  
  public void a(d paramd, boolean paramBoolean)
  {
    this.b.a(paramd, paramBoolean);
  }
  
  public a.f.j.n b(d paramd)
  {
    return this.b.c(paramd);
  }
  
  public d c(d paramd)
  {
    return this.b.b(paramd);
  }
  
  public void a(d paramd1, d paramd2)
  {
    this.b.a(paramd1, paramd2);
  }
  
  public a.f.j.o e()
  {
    return this.b.b();
  }
  
  public void f()
  {
    this.b.a(this.g);
  }
  
  public void a(d paramd, ab paramab)
  {
    if (paramab == null)
    {
      b(paramd, false);
      if (i) {
        return;
      }
      if (h == 0) {}
    }
    else
    {
      b(paramd, true);
    }
    F(paramd).e = paramab;
  }
  
  public ab d(d paramd)
  {
    boolean bool = i;
    if (!bool)
    {
      if (this.b.h(paramd)) {
        paramd = this.b.b(paramd);
      }
      if (bool) {}
    }
    else if (!w(paramd))
    {
      return null;
    }
    return (ab)F(paramd).e;
  }
  
  public void b(d paramd1, d paramd2)
  {
    F(paramd1).f = paramd2;
  }
  
  public d e(d paramd)
  {
    if (!i) {
      if (this.b.h(paramd)) {
        paramd = this.b.b(paramd);
      }
    }
    return F(paramd).f;
  }
  
  public ab f(d paramd)
  {
    if (!i) {
      if (this.b.h(paramd)) {
        paramd = this.b.b(paramd);
      }
    }
    d locald = e(paramd);
    if (locald != null) {
      return d(locald);
    }
    return null;
  }
  
  public d g(d paramd)
  {
    boolean bool = i;
    if (!bool) {
      if (this.b.h(paramd)) {
        paramd = this.b.b(paramd);
      }
    }
    v localv = F(paramd).h;
    if (!bool)
    {
      if (localv == null) {
        return null;
      }
      localv = localv.b();
    }
    if (!bool) {
      if (localv == null) {
        return null;
      }
    }
    return (d)localv.c();
  }
  
  public d h(d paramd)
  {
    boolean bool = i;
    if (!bool) {
      if (this.b.h(paramd)) {
        paramd = this.b.b(paramd);
      }
    }
    v localv = F(paramd).h;
    if (!bool)
    {
      if (localv == null) {
        return null;
      }
      localv = localv.a();
    }
    if (!bool) {
      if (localv == null) {
        return null;
      }
    }
    return (d)localv.c();
  }
  
  public void c(d paramd1, d paramd2)
  {
    F(paramd1).g = paramd2;
  }
  
  public d i(d paramd)
  {
    if (!i) {
      if (this.b.h(paramd)) {
        paramd = this.b.b(paramd);
      }
    }
    return F(paramd).g;
  }
  
  public void a(d paramd, v paramv)
  {
    F(paramd).h = paramv;
  }
  
  public v j(d paramd)
  {
    return F(paramd).h;
  }
  
  public d k(d paramd)
  {
    d locald = this.b.b(paramd);
    locald = this.a.a(paramd.f(), paramd.e());
    this.b.a(paramd, locald);
    this.b.g(locald);
    return locald;
  }
  
  public d l(d paramd)
  {
    g localg1 = this.c.a(paramd.f());
    g localg2 = this.c.a(paramd.e());
    d locald1 = this.b.b(paramd);
    if (localg1 == localg2.a())
    {
      if (i) {
        break label72;
      }
      localab = b(paramd.f());
      if (h == 0) {
        break label74;
      }
    }
    label72:
    ab localab = a(paramd.f());
    label74:
    d locald2 = (d)localab.e(localab.d(locald1)).c();
    return locald2;
  }
  
  public void m(d paramd)
  {
    F(paramd).i = true;
  }
  
  public boolean n(d paramd)
  {
    return F(paramd).i;
  }
  
  public void o(d paramd)
  {
    F(paramd).j = true;
  }
  
  public boolean p(d paramd)
  {
    return F(paramd).j;
  }
  
  public void q(d paramd)
  {
    F(paramd).k = true;
  }
  
  public boolean r(d paramd)
  {
    return F(paramd).k;
  }
  
  public void s(d paramd)
  {
    F(paramd).l = true;
  }
  
  public boolean t(d paramd)
  {
    return F(paramd).l;
  }
  
  public void u(d paramd)
  {
    F(paramd).m = true;
  }
  
  public boolean v(d paramd)
  {
    return F(paramd).m;
  }
  
  public void b(d paramd, boolean paramBoolean)
  {
    F(paramd).n = paramBoolean;
  }
  
  public boolean w(d paramd)
  {
    return F(paramd).n;
  }
  
  public void c(d paramd, boolean paramBoolean)
  {
    F(paramd).o = paramBoolean;
  }
  
  public boolean y(d paramd)
  {
    return F(paramd).o;
  }
  
  public void d(d paramd1, d paramd2)
  {
    if (paramd2 == null)
    {
      F(paramd1).o = false;
      if (i) {
        return;
      }
      if (h == 0) {}
    }
    else
    {
      F(paramd1).o = true;
    }
    F(paramd1).e = paramd2;
  }
  
  public d z(d paramd)
  {
    if (!i) {
      if (!F(paramd).o) {
        return null;
      }
    }
    return (d)F(paramd).e;
  }
  
  public void d(d paramd, boolean paramBoolean)
  {
    F(paramd).p = paramBoolean;
  }
  
  public boolean A(d paramd)
  {
    return F(paramd).p;
  }
  
  public void c(d paramd, ab paramab)
  {
    if (paramab == null)
    {
      F(paramd).p = false;
      if (i) {
        return;
      }
      if (h == 0) {}
    }
    else
    {
      F(paramd).p = true;
    }
    F(paramd).e = paramab;
  }
  
  public ab B(d paramd)
  {
    if (!i) {
      if (!F(paramd).p) {
        return null;
      }
    }
    return (ab)F(paramd).e;
  }
  
  public void C(d paramd)
  {
    F(paramd).q += 1;
  }
  
  public void D(d paramd)
  {
    F(paramd).q -= 1;
  }
  
  public void a(d paramd, int paramInt)
  {
    F(paramd).q = paramInt;
  }
  
  public int E(d paramd)
  {
    return F(paramd).q;
  }
  
  private d_ F(d paramd)
  {
    d_ locald_ = (d_)this.e.get(paramd);
    if (!i) {
      if (locald_ == null)
      {
        locald_ = g();
        this.e.a(paramd, locald_);
      }
    }
    return locald_;
  }
  
  private d_ g()
  {
    return new d_(null);
  }
  
  public ab a(e parame)
  {
    return k(parame).e;
  }
  
  public void a(e parame, ab paramab)
  {
    k(parame).e = paramab;
  }
  
  public void a(e parame, d paramd)
  {
    ab localab = a(parame);
    localab.remove(paramd);
  }
  
  public void a(e parame, d paramd1, d paramd2)
  {
    ab localab = a(parame);
    localab.b(paramd2, localab.d(paramd1));
  }
  
  public void b(e parame, d paramd1, d paramd2)
  {
    ab localab = a(parame);
    localab.a(paramd2, localab.d(paramd1));
  }
  
  public void c(e parame, d paramd1, d paramd2)
  {
    ab localab = a(parame);
    localab.b(paramd2, localab.d(paramd1));
    localab.remove(paramd1);
  }
  
  public ab b(e parame)
  {
    return k(parame).f;
  }
  
  public void c(e parame, ab paramab)
  {
    k(parame).f = paramab;
  }
  
  public void b(e parame, d paramd)
  {
    ab localab = b(parame);
    localab.remove(paramd);
  }
  
  public void e(e parame, d paramd1, d paramd2)
  {
    ab localab = b(parame);
    localab.b(paramd2, localab.d(paramd1));
  }
  
  public void g(e parame, d paramd1, d paramd2)
  {
    ab localab = b(parame);
    localab.a(paramd2, localab.d(paramd1));
  }
  
  public void h(e parame, d paramd1, d paramd2)
  {
    ab localab = b(parame);
    localab.b(paramd2, localab.d(paramd1));
    localab.remove(paramd1);
  }
  
  public void d(e parame)
  {
    k(parame).d = 1;
  }
  
  public boolean e(e parame)
  {
    if (!i) {}
    return k(parame).d == 1;
  }
  
  public boolean f(e parame)
  {
    if (!i) {}
    return k(parame).d == 0;
  }
  
  public void g(e parame)
  {
    k(parame).d = 2;
  }
  
  public boolean h(e parame)
  {
    if (!i) {}
    return k(parame).d == 2;
  }
  
  public int i(e parame)
  {
    return k(parame).d;
  }
  
  public void e(e parame, ab paramab)
  {
    k(parame).g = paramab;
  }
  
  public ab j(e parame)
  {
    return k(parame).g;
  }
  
  private b_ k(e parame)
  {
    b_ localb_ = (b_)this.d.get(parame);
    if (!i) {
      if (localb_ == null)
      {
        localb_ = new b_(null);
        localb_.f = new ab();
        localb_.e = new ab();
        localb_.d = 0;
        localb_.g = null;
        this.d.a(parame, localb_);
      }
    }
    return localb_;
  }
  
  public void h()
  {
    boolean bool = i;
    int j = h;
    do
    {
      w localw = this.a.v();
      while (j == 0)
      {
        if (!localw.e()) {
          break;
        }
        l(localw.d());
        localw.f();
      }
    } while (bool);
  }
  
  public void l(e parame)
  {
    boolean bool = i;
    int j = h;
    ab localab1 = a(parame);
    localab1.clear();
    ab localab2 = b(parame);
    localab2.clear();
    m localm = parame.n();
    label128:
    do
    {
      if (!localm.e()) {
        break;
      }
      e locale = localm.a().f();
      g localg1 = this.c.a(locale);
      g localg2 = this.c.a(parame);
      if (!bool)
      {
        if (localg2 != localg1.a()) {
          localab1.b(localm.a());
        }
      }
      else
      {
        if (bool) {
          continue;
        }
        if (j == 0) {
          break label128;
        }
      }
      localab2.b(localm.a());
      localm.f();
    } while (j == 0);
  }
  
  public void i()
  {
    boolean bool = i;
    int j = h;
    do
    {
      w localw = this.a.v();
      while (j == 0)
      {
        if (!localw.e()) {
          break;
        }
        m(localw.d());
        localw.f();
      }
    } while (bool);
  }
  
  public void m(e parame)
  {
    ab localab = new ab();
    localab.a(b(parame).l());
    localab.a(a(parame).l());
    parame.b(new c_(localab));
  }
  
  public a.f.j.n[] a(a.f.j.n paramn, d paramd)
  {
    this.b.b.remove(paramn);
    a.f.j.n[] arrayOfn = new a.f.j.n[2];
    boolean[] arrayOfBoolean = new boolean[this.a.l()];
    arrayOfn[0] = this.b.a(paramd, this.g, arrayOfBoolean);
    arrayOfn[1] = this.b.a(c(paramd), this.g, arrayOfBoolean);
    return arrayOfn;
  }
  
  public a.f.j.n[] a(a.f.j.n paramn, d paramd, e parame)
  {
    boolean bool = i;
    int j = h;
    d locald1 = paramd;
    if ((bool) || (paramd.f() == parame)) {
      locald1 = c(paramd);
    }
    ab localab = a(parame);
    v localv = localab.d(locald1);
    localv = localab.e(localv);
    d locald2 = c((d)localv.c());
    localv = localab.e(localab.e(localv));
    d locald3 = (d)localv.c();
    d locald4 = null;
    Object localObject = paramn.a();
    if (((m)localObject).e()) {
      locald4 = ((m)localObject).a();
    }
    while (bool)
    {
      if (j != 0) {
        break label182;
      }
      if ((bool) || ((locald4.e() != locald3.f()) || (locald4.f() != locald2.e())))
      {
        ((m)localObject).f();
        if (j == 0) {
          break;
        }
      }
    }
    if (locald4 == null) {
      label182:
      System.out.println("Error in splitFace!");
    }
    locald4 = c(locald4);
    localObject = b(locald4);
    ((a.f.j.n)localObject).a(locald4, locald2, locald3);
    this.b.a(locald2, (a.f.j.n)localObject);
    this.b.a(locald3, (a.f.j.n)localObject);
    if ((bool) || (q.n)) {
      h = ++j;
    }
    if (bool) {
      q.o = !q.o;
    }
    return a(paramn, paramd);
  }
  
  public void k()
  {
    boolean bool = i;
    int j = h;
    w localw = this.a.v();
    label140:
    label142:
    do
    {
      do
      {
        if (!localw.e()) {
          return;
        }
        e locale = localw.d();
        System.out.println("\nNode [" + locale + "]: ");
        m localm = locale.n();
        do
        {
          if (!localm.e()) {
            break;
          }
          System.out.println("\t" + localm.a());
          localm.f();
          if (bool) {
            break label142;
          }
          if (j != 0) {
            break label140;
          }
        } while (j == 0);
      } while (bool);
      localw.f();
    } while (j == 0);
  }
  
  public void l()
  {
    int j = h;
    System.out.println("\nEdgeorders: \n-----------");
    w localw = this.a.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      System.out.println("\nNode [" + locale + "]: ");
      System.out.println("Inner edges: ");
      a(b(locale));
      System.out.println("Outer edges: ");
      a(a(locale));
      localw.f();
    } while (j == 0);
  }
  
  public void m()
  {
    boolean bool = i;
    int j = h;
    w localw = this.a.v();
    label166:
    label168:
    do
    {
      do
      {
        if (!localw.e()) {
          return;
        }
        e locale = localw.d();
        System.out.println("\nNode [" + locale + "]: ");
        System.out.println("Outedges: ");
        m localm = locale.n();
        do
        {
          if (!localm.e()) {
            break;
          }
          System.out.println("\t" + localm.a() + "\t" + e(localm.a()));
          localm.f();
          if (bool) {
            break label168;
          }
          if (j != 0) {
            break label166;
          }
        } while (j == 0);
      } while (bool);
      localw.f();
    } while (j == 0);
  }
  
  private void a(ab paramab)
  {
    boolean bool = i;
    int j = h;
    do
    {
      m localm = paramab.l();
      while (j == 0)
      {
        if (!localm.e()) {
          break;
        }
        System.out.println(localm.a() + "\t" + e(localm.a()));
        localm.f();
      }
    } while (bool);
  }
  
  public void n()
  {
    boolean bool = i;
    int j = h;
    System.out.println("\nFaces: \n------");
    do
    {
      a.f.j.o localo = this.b.b();
      while (j == 0)
      {
        if (!localo.e()) {
          break;
        }
        System.out.println(localo.a());
        localo.f();
      }
    } while (bool);
  }
  
  static class c_
    implements Comparator
  {
    private ab a;
    
    c_(ab paramab)
    {
      this.a = paramab;
    }
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      d locald1 = (d)paramObject1;
      d locald2 = (d)paramObject2;
      return l.a(this.a.indexOf(locald1), this.a.indexOf(locald2));
    }
  }
  
  private static class b_
  {
    private static final int a = 0;
    private static final int b = 1;
    private static final int c = 2;
    int d;
    ab e;
    ab f;
    ab g;
    
    private b_() {}
    
    b_(b.0 param0)
    {
      this();
    }
  }
  
  private static class d_
    extends ab.b_
  {
    Object e;
    d f;
    d g;
    v h;
    boolean i;
    boolean j;
    boolean k;
    boolean l;
    boolean m;
    boolean n;
    boolean o;
    boolean p;
    int q = 0;
    
    private d_() {}
    
    d_(b.0 param0)
    {
      this();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.a.b.b

 * JD-Core Version:    0.7.0.1

 */